﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;


namespace RecommendatioNetwork
{

    
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    ///
    public partial class App : Application
    {
        public Model MyModel { get; set; }
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
            MyModel = new Model();

        }

        //gestore dell'evento Eccezione non gestita
        void App_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
        {
            MessageBox.Show("Exception non gestita", "Exception", MessageBoxButton.OK, MessageBoxImage.Error);
        }


        protected override void OnExit(ExitEventArgs e)
        {
            base.OnExit(e);
            //esegue codice all'uscita dell'aplicazione
            MyModel.SaveModel();
        }
    }
}
